$(function(){
    // 曲线图
    // profit('qianli_chart',[[2017-01-01,2017-02-02,2017-03-03],[88,77,55]])
    // 横向列表和块状列表选项卡
    $(".SX_left span").click(function() {
        $(".L_SX_con ul").hide().eq($(this).index()).show();
    });
})
function profit(id,data){
    var t = this;
    return new Highcharts.Chart({
        chart: {
            renderTo: id,
            type: "areaspline",
            zoomType: "xy",
            backgroundColor: '#1e2635'
        },
        title: {
            text : null
        },
        subtitle: {
            text: null,
            align: 'left',
            verticalAlign: 'bottom'
        },
        colors: ["#ffc766"],
        legend: {
            enabled: false
        },
        credits: {
            enabled: false
        },
        exporting: {
            enabled:false
        },
        xAxis: {
            lineWidth: 0, //去掉坐标轴
            gridLineWidth: 0,
            tickLength: 0, // 去掉坐标轴刻度线
            categories:data[0],
            labels: {
                enabled: !1
            }
        },
        yAxis: {
            gridLineWidth: 0,
            labels: {// 去掉Y轴
                enabled: !1
            },
            title: {
                text: null
            }
        },
        tooltip: {
            style: {
                color: "white"
            },
            borderWidth: 1,
            shadow: !1,
            shared: !0,
            backgroundColor: 'rgba(0,0,0)',   // 背景颜色
            borderColor: '#e99d32',       // 边框颜色
            formatter : function (){ // 提示框格式化字符串
                var s;
                $.each(this.points ,function(){
                    s = '<b>总收入: ' + this.y+'点'+'</b><br/>';
                });
                s += '<b>截止: '+this.x+'</b>';
                return s;
            }
        },
        plotOptions: {
            areaspline: {
                fillColor: {
                    linearGradient: {
                        x1: 0,
                        y1: 0,
                        x2: 0,
                        y2: 1
                    },
                    stops: [
                        [0, "#1e2635"],
                        [1, Highcharts.Color("#1e2635" , "#1e2635").setOpacity(0).get('rgba')]
                    ]
                },
                marker: {
                    radius: 0,
                    fillColor: "white",
                    lineWidth: 1,
                    lineColor: "#ffc766"
                },
                lineWidth: 1,
                states: {
                    hover: {
                        lineWidth: 1
                    }
                },
                threshold: null
            },
            series: {
                lineColor: "#e99d32"
            }
        },
        series: [{
            name: "盈利点位",
            data: data[1]
        }]
    })
}
